// scripts.js
document.addEventListener('DOMContentLoaded', function() {
    const form = document.getElementById('login-form');
    form.addEventListener('submit', function(event) {
        event.preventDefault();
        const username = document.getElementById('username').value;
        const password = document.getElementById('password').value;

        if (!username || !password) {
            alert("请填写所有字段！");
            return;
        }

        // 模拟登录验证
        if (username === 'admin' && password === 'password') {
            document.getElementById('successRedirect').click(); // 触发跳转
        } else {
            alert("用户名或密码错误！");
        }
    });
});